<template>
  <div class="login">
    <div class="loginTop">欢迎登录</div>
    <div class="loginContent">
      <van-cell-group inset>
        <!-- 输入手机号，调起手机号键盘 -->
        <van-field v-model="phone" type="tel" label="手机号" />
        <!-- 输入密码 -->
        <van-field v-model="password" type="password" label="密码" />
      </van-cell-group>
      <van-button type="primary" @click="Login()">登录</van-button>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
        phone: "",
        password: "",
    };
  },
  methods: {
    async Login() {
      let res = await this.$store.dispatch("getLogin", {phone: this.phone,password:this.password});
      console.log(res);
    },
  },
};
</script>

<style lang="less" scoped>
.login {
  width: 100%;
  height: 13.34rem;
  padding: 0.2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  background-image: linear-gradient(to right bottom, #ff0000, #fff200, #1e9600);
  .loginTop {
    margin-top: 1rem;
    font-size: 1rem;
    color: #fff;
  }
  .loginContent {
    width: 100%;
    height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-around;
    margin-top: 2rem;
    .phone,
    .passworld {
      width: 5rem;
      height: 1rem;
      border: 0.02rem solid #999;
    }
  }
}
</style>
